//专题列表
export const topics =  function (params) {
  let {axios,...otherParams} = params;
  return axios.$get('/topics',{
    params:otherParams
  })
}

//专题详情
export const topic =  function (params) {
  let {axios,...otherParams} = params;
  return axios.$get('/topic/'+otherParams.params.id)
}

//个人详情页
export const user =  function (params) {
  let {axios,...otherParams} = params;
  return axios.$get('/user/'+otherParams.params.id)
}

//用户登录
export const accesstoken  =  function (params) {
  let {axios,...otherParams} = params;
  return axios({
    method: 'POST',
    url: '/accesstoken',
    data: otherParams
  })
}


//新建专题
export const createTopic  =  function (params) {
  let {axios,...otherParams} = params;
  return axios({
    method: 'POST',
    url: '/topics',
    data: otherParams
  })
}

//新建评论
export const createReplie =  function (params) {
  let {axios,...otherParams} = params;
  return axios({
    method: 'POST',
    url: `/topic/${otherParams.id}/replies`,
    data: otherParams
  })
}

